//获取主题
if (window.localStorage) {
	var theme = localStorage["theme"]; //获取theme的值
	changeTheme(theme); //改变主题
} else {
	document.getElementById('theme').style.color = "#000000";
}

//改变主题
function changeTheme(theme) {

	if (theme != null && theme != '') {
		if (theme == 'red' && theme != '') {
			document.getElementById('theme').style.color = "#E00000";
		} else if (theme == 'green') {
			document.getElementById('theme').style.color = "#0AA770";
		} else if (theme == 'blue') {
			document.getElementById('theme').style.color = "#0000FF";
		} else {
			document.getElementById('theme').style.color = "#000000";
		}
	} else {
		document.getElementById('theme').style.color = "#000000";
	}

	setTheme(theme); //设置主题
}

//设置主题方法
function setTheme(value) {
	if (window.localStorage) {
		localStorage["theme"] = value; //设置theme为"red"
	} else {
		alert('您的浏览器不支持设置主题！！！');
	}
}